Skip to content

Remove hard-coded project version#759

Merged
dennisvang merged 9 commits into
masterfrom
maintenance/issue624
Jun 22, 2026
Merged

Remove hard-coded project version#759
dennisvang merged 9 commits into
masterfrom
maintenance/issue624

Conversation

@dennisvang

@dennisvang dennisvang commented Aug 25, 2025

Copy link
Copy Markdown
Contributor

This removes the hard-coded project version from the pom.xml and application.yml, so git tags and code cannot get out of sync.

  • use maven revision property to enable command line override of project.version in pom
    (set default to dev, so it's clear when version is not provided)
  • assign project.version to openapi.version in application.yml
  • override project.version using git tag in github docker build workflow
  • fix output of git describe in the generated git.properties file, by including lightweight tags

fixes #624

notes

  • The version returned by /actuator/info (client "about" link) already comes from the git ref, and so does the version in the docker image name.
  • If we could assign the git tag to project.version directly in the pom, there would be no need to modify the github workflows and Dockerfile. However, although git-commit-id-maven-plugin can expose the git info to the pom, I don't think this can be used to set the maven project.version directly. For example, ${git.commit.id.describe-short} is not evaluated when used inside the project version tag, despite enabling injectAllReactorProjects in the plugin config.
  • An alternative would be to use an additional dependency like qoomon/maven-git-versioning-extension, but we should minimize the number of dependencies.

@dennisvang
dennisvang marked this pull request as ready for review August 25, 2025 17:51
@dennisvang dennisvang changed the title Project version based on git tag Consistent project versioning Aug 25, 2025
@dennisvang
dennisvang force-pushed the maintenance/issue624 branch from ea818fd to b4d0436 Compare August 26, 2025 07:32
@dennisvang dennisvang changed the title Consistent project versioning Remove hard-coded project version Aug 26, 2025
@dennisvang dennisvang added chore Maintenance improvement Existing functionality that can be improved labels Jun 9, 2026
@dennisvang
dennisvang changed the base branch from develop to master June 22, 2026 09:09
using maven property expansion
following https://maven.apache.org/guides/mini/guide-maven-ci-friendly.html

use major version as default for the revision, because this hardly ever changes
requires update of the docker-publish workflow to support the build-args input
this way we never need to update, and it is immediately clear if no version override is supplied
…escribe

this is necessary because tags created via the github release page are lightweight instead of annotated

the output of describe can be found in the generated META-INF/git.properties file
@dennisvang
dennisvang force-pushed the maintenance/issue624 branch from 9f08e74 to 2d8825a Compare June 22, 2026 09:25
@dennisvang dennisvang added the dev Related to development, e.g. code style, refactoring, github workflows, etc. label Jun 22, 2026
@dennisvang
dennisvang merged commit cc5529d into master Jun 22, 2026
@dennisvang
dennisvang deleted the maintenance/issue624 branch June 22, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance dev Related to development, e.g. code style, refactoring, github workflows, etc. improvement Existing functionality that can be improved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Single source of truth for version

1 participant